{% load i18n %}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=1024, initial-scale=1.0, user-scalable=yes">
		<title>{% block title %}Base Template{% endblock %}</title>
		<link rel="shortcut icon" href="/static/favicon.ico"/>
		<link rel="stylesheet" type="text/css" href="/static/css/style.css">
		{% block head %}{% endblock %}
	</head>
	<body>
		<div id="wrapper">
			<div id="country-select">
			{% get_available_languages as LANGUAGES %}
			{% get_current_language as LANGUAGE_CODE %}
			<form id="languageForm" action="/i18n/setlang/" method="post">
				<select id="country-options" name="language">
					{% for code, desc in LANGUAGES %}
					<option value="{{ code }}" {% ifequal code LANGUAGE_CODE %}selected="selected"{% endifequal %}>{{ desc|title }}</option>
					{% endfor %}
				</select>
				<input type="submit" value="Change">
				{% csrf_token %}
			</form> 
			</div>
			{% if user %}
			<div id="toolbar">{%trans "Hi"%} {{user.first_name}} | <a href="/mrEdu/logout" title="{%trans "Logout from application"%}">{%trans "Logout"%}</a></div>
			{% endif %}
			<header>
				<span id="title">Mr. Edu</span>
				<span id="claim">{% trans "A semantic repository for collaborative digital storytelling" %}</span>
			</header>
			<hr>
			{% block nav%}
			{% if user %}
			<nav>
				<ul>
					{% if section == 'dashboard'%}
					<li><a href="/mrEdu/{{userRole}}" id="current">{%trans "[MENU] Dashboard"%}</a></li>
					{% else %}
					<li><a href="/mrEdu/{{userRole}}">{%trans "[MENU] Dashboard"%}</a></li>
					{% endif %}
					
					{% if section == 'upload'%}
					<li><a href="/mrEdu/{{userRole}}/content/upload" id="current">{%trans "[MENU] Upload my contents"%}</a></li>
					{% else %}
					<li><a href="/mrEdu/{{userRole}}/content/upload">{%trans "[MENU] Upload my contents"%}</a></li>
					{% endif %}
					
					{% if section == 'collection'%}
					<li><a href="/mrEdu/{{userRole}}/collections" id="current">{%trans "[MENU] My folders"%}</a></li>
					{% else %}
					<li><a href="/mrEdu/{{userRole}}/collections">{%trans "[MENU] My folders"%}</a></li>
					{% endif %}
					
					{% if userRole == 'teacher' %}
						{% if section == 'course'%}
					<li><a href="/mrEdu/{{userRole}}/classes" id="current">{%trans "[MENU] My classes"%}</a></li>
						{% else %}
					<li><a href="/mrEdu/{{userRole}}/classes">{%trans "[MENU] My classes"%}</a></li>
						{% endif %}
					{% endif %}
					
					{% if section == 'search'%}
					<li><a href="/mrEdu/{{userRole}}/search" id="current">{%trans "[MENU] Search"%}</a></li>
					{% else %}
					<li><a href="/mrEdu/{{userRole}}/search">{%trans "[MENU] Search"%}</a></li>
					{% endif %}
				</ul>
			</nav>
			{% endif %}
			{% endblock %}
			<hr>
			<section id="content">
				{% block section %}Content{% endblock %}
			</section>
			<hr>
			<footer>
				&copy <address><a href="http://eliacontini.info">Elia Contini</a></address> 2011. Mr. Edu <abbr title="version">v</abbr>0.0.6
			</footer>
		</div>
		<script type="text/javascript" charset="UTF-8" src="/static/js/jquery-1.6.4.min.js"></script>
		<script type="text/javascript" charset="UTF-8" src="/static/js/languageswitcher.js"></script>
		{% block script%}
		{% endblock %}
	</body>
</html>